package com.coldwindblows.controller;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.coldwindblows.annotation.Autowired;
import com.coldwindblows.annotation.Controller;
import com.coldwindblows.annotation.RequestMapping;
import com.coldwindblows.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping(value = "/detail", method = "GET")
	public String select(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException {
		String name = request.getParameter("name");
		System.out.println(name);
		String result = userService.getDetail(name);
		return result;
	}
	
	@RequestMapping(value = "/add", method = "POST")
	public String add(HttpServletRequest request, HttpServletResponse response) {
		return "add";
	}
}
